<!DOCTYPE html>
<html>
	<head>
		<meta charset="UTF-8">
		<title></title>
	</head>
	<body>
		<div id="app">
			<template v-if="loginType === 'username'">
			  	<label>Username</label>
			  	<input placeholder="Enter your username" key="username-input">
			</template>
			<template v-else>
			  	<label>Email</label>
			  	<input placeholder="Enter your email address" key="email-input">
			</template>
			<button v-on:click="toggle">提交</button>
		</div>
		<script src="https://unpkg.com/vue/dist/vue.js"></script>
		<script>
			var app=new Vue({
				el:'#app',
				data:{
					loginType:'username'
				},
				methods:{
					toggle:function(){
						if(this.loginType==='username'){
							this.loginType='';
						}else{
							this.loginType='username';
						}
					}
				}
				
			})
			console.log(app)
		</script>
	</body>
</html>

